package com.whxd.framework.utils;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.apache.commons.lang3.StringUtils;

/**
 * 类描述
 * 
 * @author 张世鹏
 * @since 2013-6-6
 */
public class StringSplit {

	public static List<Long> splitToLong(String str, String splitChar) {
		if (StringUtils.isBlank(str)) {
			return null;
		}
		String[] strArray = StringUtils.split(str, splitChar);
		List<Long> result = new ArrayList<Long>();
		for (String t : strArray) {
			result.add(Long.parseLong(t));
		}
		return result;
	}

	public static List<String> splitToString(String str, String splitChar) {
		if (StringUtils.isBlank(str)) {
			return null;
		}
		
		List<String> result = new ArrayList<String>();
		String[] strArray = StringUtils.split(str, splitChar);
		Collections.addAll(result, strArray);

		return result;

	}
}
